Draft
Conversation
This commit removes TODO comments from the codebase that were triaged and marked as "Won't Do" in the Nexus Python SDK TODO tracking document. These comments documented items that were decided not to be implemented or were already completed. Removed TODO comments from: - temporalio/worker/_activity.py (2 comments) - temporalio/workflow.py (1 comment) - temporalio/worker/_nexus.py (1 comment) - temporalio/nexus/_token.py (1 comment) - tests/nexus/test_workflow_caller.py (3 comments) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… for NexusOperationHandle
Add comprehensive round-trip tests for failure converter handling of: - nexusrpc.HandlerError (all HandlerErrorType values, retryable_override mapping) - NexusOperationError (all fields, cause chains) - nexusrpc.OperationError (one-way from_failure) - nexus_sdk_failure_error_info (one-way to FailureError) - ResetWorkflowError (with and without heartbeat details) Also tests fallback behavior for unknown handler error types and operation error states. Remove TODO(nexus-preview) comment as test coverage is now in place. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…al failures everywhere instead of helpers
The HTTP interface is not user-facing. Delete test_handler.py and test_handler_async_operation.py which tested via direct HTTP calls. Convert test_workflow_run_operation.py and test_dynamic_creation_of_user_handler_classes.py to use workflow callers instead. Remove HTTP-specific helper code (ServiceClient, Failure, dataclass_as_dict) from tests/helpers/nexus.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace the class-based ErrorConversionTestCase pattern with a simpler dataclass-based approach: - Remove ErrorConversionTestCase base class and registry pattern - Add typed dataclasses for expected exceptions: ExpectedNexusOperationError, ExpectedHandlerError, and ExpectedApplicationError - Move operation implementations from class methods to explicit ErrorTestService handler methods - Replace tuple-based expected_exception_chain_in_workflow with typed expected_exception_chain using the new dataclasses - Refactor _validate_exception_chain to use isinstance() checks instead of string key comparisons on dict[str, Any] - Update workflow to call operations by name rather than through registry lookup Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…on server capabilities
… no longer apply with the most recent api update
…havior when reset_workflow_failure_info is set on a failure. Remove some stale comments
VegetarianOrc
commented
Feb 11, 2026
| temporalio.exceptions.FailureError | ||
| | nexusrpc.HandlerError | ||
| ) | ||
| match failure.WhichOneof("failure_info"): |
Contributor
Author
There was a problem hiding this comment.
I changed this to use match here to help ensure all cases are handled explicitly. This change was more helpful when there were more failure info types added in a previous version of the API. Can switch back to old style if it is preferred.
…failure when deserializing or serializing HandlerErrors
…e handler error messages
Add comprehensive tests for RPCError -> HandlerError conversion in Nexus operations: - test_rpc_error_fails_without_retry: Tests non-retryable RPCError status codes (INVALID_ARGUMENT, ALREADY_EXISTS, FAILED_PRECONDITION, OUT_OF_RANGE, NOT_FOUND, UNIMPLEMENTED) and verifies they map to correct HandlerErrorType without retry - test_rpc_error_is_retried: Tests retryable RPCError status codes (ABORTED, UNAVAILABLE, CANCELLED, DATA_LOSS, INTERNAL, UNKNOWN, UNAUTHENTICATED, PERMISSION_DENIED, RESOURCE_EXHAUSTED, DEADLINE_EXCEEDED, OK) and verifies they cause retry behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… Add tests to cover the two failure scenarios.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note This PR can't be merged until the corresponding Core PR (temporalio/sdk-core#1109) is merged and updated in this branch and the nexus-rpc PR (nexus-rpc/sdk-python#45) is merged and released
What was changed
nexus.v1.Failurewith metadata/details), Nexus handler errors and operation errors are now serialized as standard Temporalfailure.v1.Failureprotos via the SDK'sDataConverter/FailureConverter. This includesHandlerError→nexus_handler_failure_infoandOperationError→CancelledError/ApplicationErrorconversions._nexus.pyworker code: Removed the_nexus_error_to_nexus_failure_proto,_operation_error_to_proto, and_handler_error_to_protohelper methods. Errors are now encoded directly throughdata_converter.encode_failure()into the completion/response proto'sfailurefield._exception_to_handler_error: Removed the workaround that inserted an extraApplicationErrorat the head of theHandlerErrorcause chain (previously needed to preserve theHandlerErrormessage when hoisted to the Nexus Failure)._error_to_failureforHandlerErrornow useserror.messageanderror.stack_traceinstead ofstr(error).from_failureusesmatch/caseinstead ofif/elifchains.nexus_pb2,workflow_activation_pb2,workflow_commands_pb2, and the sdk-core submodule to support the new Nexus failure fields on completion protos.test_handler.pyandtest_handler_async_operation.pywhich tested via direct HTTP calls (the HTTP interface is not user-facing). Converted remaining tests (test_workflow_run_operation.py,test_dynamic_creation_of_user_handler_classes.py) to use workflow callers.ErrorConversionTestCaseregistry pattern with typed dataclasses (ExpectedNexusOperationError,ExpectedHandlerError,ExpectedApplicationError,ExpectedCancelledError) and explicitErrorTestServicehandler methods.test_converter.pyfor round-trip serialization ofHandlerError,NexusOperationError,OperationError, and related types.self._interceptorsvariable in the Nexus worker.Why?
The previous Nexus error serialization used a custom JSON-based format (
nexus.v1.Failurewith metadata and JSON details) that was specific to the Nexus HTTP protocol. With the move to have Core SDK handle protocol-level conversion based on server capabilities, the Python SDK now only needs to produce standard Temporal Failure protos.Checklist
How was this tested:
FailureConverterround-trip serialization of Nexus error types intests/test_converter.pytests/nexus/test_workflow_caller_error_chains.pyAny docs updates needed?